<template>
  <div class="cs-card" :class="'cs-card' + csData.name">
    <div class="item-detail-num">
      <div class="title">{{ csData.name }}类</div>
      <div class="num">
        <CountTo
                :startVal="startVal"
                :endVal="csData.num"
                :duration="duration"/>
        <span>({{ csData.unit }})</span>
      </div>
    </div>

    <div class="icon">
      <div>占比</div>
      <div class="num">
         <CountTo
                :startVal="startVal"
                :endVal="csData.radio"
                :duration="duration"/>
        %</div>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    csData: {},
  },
  data() {
    return {
      startVal:0,
      duration:3000

    };
  },
  components: {},
  mounted() {
    console.log("csData----->",this.csData);
  },
  beforeDestroy() {},
  methods: {},
};
</script>

<style lang="scss" scoped>
.cs-card {
  width: 203px;
  height: 88px;

  display: flex;
  justify-content: center;
  align-items: center;
  .item-detail-num {
    margin-left: 6px;
    font-size: 20px;
    font-weight: bold;
    color: #fff;
    line-height: 1.2;

    .num {
      color: #34effe;
      span {
        color: #fff;
        font-size:14px;
      }
    }
  }
  .icon {
    margin-left: 9px;
    margin-top: 10px;
    font-size: 12px;
    .num {
      display: flex;
      color: #34effe;
    }
  }
}

.cs-cardA {
  background:url(../../assets/regulation/bg.png) no-repeat;
  background-size:100% 100%;
}

.cs-cardB {
  background:url(../../assets/regulation/bg1.png) no-repeat;
  background-size:100% 100%;
}

.cs-cardC {
  background:url(../../assets/regulation/bg2.png) no-repeat;
  background-size:100% 100%;
}

.cs-cardD {
  background:url(../../assets/regulation/bg3.png) no-repeat;
  background-size:100% 100%;
}
</style>
